﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>store-工分商店</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/mui.min.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
			
			.mui-control-item {
				font-size: 24px; !important;
			}
		</style>
	</head>

	<body>
		<div id="slider" class="mui-slider" >
			<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
				<div class="mui-scroll">
					<a class="mui-control-item mui-active" href="#item0mobile" data-wid="store-subpage-0.html">推荐</a>
					<a class="mui-control-item" href="#item1mobile" data-wid="store-subpage-1.html">食物</a>
					<a class="mui-control-item" href="#item2mobile" data-wid="store-subpage-2.html">居家</a>
					<a class="mui-control-item" href="#item3mobile" data-wid="store-subpage-3.html">生活用品</a>
					<a class="mui-control-item" href="#item4mobile" data-wid="store-subpage-4.html">其他</a>
				</div>
			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/webviewGroup.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/common.js"></script>
		<script src="js/app.js"></script>
		<script>
			mui.init();			
			mui.plusReady(function() {
				var _self = plus.webview.currentWebview();
				var group = new webviewGroup(_self.id, {
					items: [{
						id: "store-subpage-0.html",
						url: "store-subpage-0.html",
						extras: {}
					}, {
						id: "store-subpage-1.html",
						url: "store-subpage-1.html",
						extras: {}
					}, {
						id: "store-subpage-2.html",
						url: "store-subpage-2.html",
						extras: {}
					}, {
						id: "store-subpage-3.html",
						url: "store-subpage-3.html",
						extras: {}
					}, {
						id: "store-subpage-4.html",
						url: "store-subpage-4.html",
						extras: {}
					}],
					styles: {
						top:"0px",  //子页面顶部位置
				        bottom:"0px", //子页面底部位置
						width:"100%", //子页面宽度
						height:"100%", //子页面高度
				        bounce:"vertical"
					},
					onChange: function(obj) {
						var c = document.querySelector(".mui-control-item.mui-active");
						if(c) {
							c.classList.remove("mui-active");
						}
						var target = document.querySelector(".mui-scroll .mui-control-item:nth-child(" + (parseInt(obj.index) + 1) + ")");
						target.classList.add("mui-active");
						if(target.scrollIntoView) {
							target.scrollIntoView();
						}
					}
				});
				mui(".mui-scroll").on("tap", ".mui-control-item", function(e) {
					var wid = this.getAttribute("data-wid");
					group.switchTab(wid);
				});
			});
			
		</script>
	</body>

</html>